-- Copyright The Slam Authors

include "map_builder.lua"
include "trajectory_builder.lua"

options = {
  map_builder = MAP_BUILDER,
  trajectory_builder = TRAJECTORY_BUILDER,
  map_frame = "map",
  tracking_frame = "base_link",
  published_frame = "base_link", 
  odom_frame = "odom",
  provide_odom_frame = true,
  publish_frame_projected_to_2d = false,
  use_odometry = true,
  use_nav_sat = false,
  use_landmarks = false,
  use_qr_code = true,
  qr_code_translation_weight=1e5,
  qr_code_rotation_weight=1e5,
  num_laser_scans = 1,
  num_multi_echo_laser_scans = 0,
  num_subdivisions_per_laser_scan = 1,
  num_point_clouds = 0,
  lookup_transform_timeout_sec = 0.2,
  submap_publish_period_sec = 0.3,
  pose_publish_period_sec = 5e-2,
  trajectory_publish_period_sec = 5e-2,
  rangefinder_sampling_ratio = 1.,
  odometry_sampling_ratio = 1.,
  fixed_frame_pose_sampling_ratio = 1.,
  imu_sampling_ratio = 1.,
  landmarks_sampling_ratio = 1.,
  qr_code_sampling_ratio = 0.4,
  cache_data_time_duration_sec = 1200,
  sensor_data_log_path = "Slam_log/sensor_data",
  initial_pose_time_interval_sec = -1,
}

TRAJECTORY_BUILDER_2D.submaps.num_range_data = 100
POSE_GRAPH.optimize_every_n_nodes = 5

TRAJECTORY_BUILDER_2D.use_odom_in_front = true
TRAJECTORY_BUILDER_2D.use_imu_data = false --true
TRAJECTORY_BUILDER_2D.min_range = 0.5
TRAJECTORY_BUILDER_2D.max_range = 80

TRAJECTORY_BUILDER_2D.motion_filter.max_time_seconds = 5
TRAJECTORY_BUILDER_2D.motion_filter.max_angle_radians = math.rad(5)
TRAJECTORY_BUILDER_2D.motion_filter.max_distance_meters = 0.2

POSE_GRAPH.constraint_builder.mapping_mode = true
POSE_GRAPH.constraint_builder.localization_mode = true
POSE_GRAPH.constraint_builder.fast_correlative_scan_matcher.linear_search_window = 7.
POSE_GRAPH.constraint_builder.fast_correlative_scan_matcher.angular_search_window = math.rad(30.)

POSE_GRAPH.use_constraint_check = true

return options
